<?php

header("Content-type:text/html;charset=utf-8");

require_once './mysql.function.php';


if (empty($_GET['name'])) {
    echo "错误哦！";
	exit();
}

if (!preg_match('/^[\w\x{4e00}-\x{9fa5}]+$/u', $_GET['name'])) {
	echo "搞事请哦！";
	exit();
}

$sqlhelper = new sqlhelper();
$sql = "select name, student_id, class, mentor_name,mentor_info  from zhbitjsj2017 where name = '{$_GET['name']}'";
$arr = $sqlhelper->fetchone($sql);
  

if (empty($arr)) {
	echo "没有找到数据";
	exit();
}

echo "{\n";

echo "  \"name\" : \"{$arr['name']}\",\n";
echo "  \"student_id\" : \"{$arr['student_id']}\",\n";
echo "  \"class\" : \"{$arr['class']}\",\n";
echo "  \"mentor_name\" : \"{$arr['mentor_name']}\"";

if ($arr['mentor_info']) {	
   echo ",\n";
   echo "  \"mentor_info\" : \"<a href='{$arr['mentor_info']}'>班助信息</a>\"\n";
}

echo "}\n";

echo "\n\n";
echo "想了解这串是什么东西嘛？<a href='http://v.xiumi.us/board/v5/2YXM6/56091630'>点击带来开计算机的第一趟车</a>";


